package com.incms.web.modules.system.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.incms.web.common.util.Page;
import com.incms.web.modules.system.dao.SysUserDao;
import com.incms.web.modules.system.entity.SysUser;

@Service("sysUserServcie")

public class SysUserService{
	
	@Resource(name = "sysUserDao")
	private SysUserDao sysUserDao;
	
	/**
	 * 分页查询
	 */
	@Transactional(readOnly=true)
	public Page<SysUser> querySysUserPage(SysUser sysuser,Page<SysUser> page){
		return sysUserDao.querySysUserPage(sysuser, page);
	}
	
	/**
	 * 保存操作
	 */
	@Transactional
	public Long save(SysUser sysUser){
		return sysUserDao.save(sysUser);
	}
	/**
	 * 根据用户名查询
	 */
	@Transactional
	public SysUser findByUsername(String username){
		 return sysUserDao.findByUsername(username);
	}
	
	/**
	 * 根据用户编号查询
	 */
	@Transactional
	public SysUser findById(Long userId){
		return sysUserDao.findById(userId);
	}
	
	/**
	 * 更新用户信息
	 */
	@Transactional
	public Long update(SysUser sysUser){
		return sysUserDao.update(sysUser);
	}
	
	@Transactional
	public Long delete(Long userId){
		return sysUserDao.delete(userId);
	}
	
}
